﻿using System.Linq;
using System.Web;
using System.Xml.Linq;
using Asd.MP.Utility;

namespace Asd.MP.Utility
{
    /// <summary>
    /// 数据库访问操作类
    /// </summary>
    public class DataBaseExecuter
    {
        /// <summary>
        /// 根据传入的数据库访问类名创建类实例
        /// </summary>
        /// <typeparam name="T">类的类型（接口，例：IClassModule）</typeparam>
        /// <param name="className">类名（例：ClassModule）</param>
        /// <returns>类的实例</returns>
        public static T CreateClassByName<T>(string className)
        {
            string assembly = "Asd.MP.DataAccess";
            string connecitonString = "";
            T classIns = new Factory(assembly, connecitonString).CreateClassByName<T>(className);
            return classIns;
        }
    }
}
